# - Find USB
# Find the native USB includes and library
# This module defines
#  USB_INCLUDE_DIR, where to find owcapi.h, etc.
#  USB_LIBRARIES, the libraries needed to use .
#  USB_FOUND, If false, do not try to use owcapi etc.


FIND_PATH(USB_INCLUDE_DIR usb.h)

FIND_LIBRARY(USB_LIBRARIES NAMES usb)

IF (USB_LIBRARIES AND USB_INCLUDE_DIR)
  SET(USB_FOUND "YES")
ELSE (USB_LIBRARIES AND USB_INCLUDE_DIR)
  SET(USB_FOUND "NO")
ENDIF (USB_LIBRARIES AND USB_INCLUDE_DIR)

IF (USB_FOUND)
   IF (NOT USB_FIND_QUIETLY)
      MESSAGE(STATUS "Found USB: ${USB_LIBRARIES}")
   ENDIF (NOT USB_FIND_QUIETLY)
ELSE (USB_FOUND)
   IF (USB_FIND_REQUIRED)
      MESSAGE(FATAL_ERROR "Could not find USB library, please configure USB_LIBRARIES and USB_INCLUDE_DIR")
   ENDIF (USB_FIND_REQUIRED)
ENDIF (USB_FOUND)

MARK_AS_ADVANCED(USB_LIBRARIES USB_INCLUDE_DIR)

